import http from "../index";

// 分页获取下单有礼信息
export const getOrderGifts = ({
    ascended = null,
    current = null,
    size = null,
    sortFieldName = null,
    status = null,
    prezzieType = null,
}) => {
    return http.get("order-gift", {
        ascended,
        current,
        size,
        sortFieldName,
        status,
        prezzieType,
    });
};

// 根据sid获取下单有礼信息
export const getOrderGiftDetail = ({ sid }) => {
    return http.get("order-gift/" + sid);
};

// 新增下单有礼
export const addOrderGift = ({
    prezzieNum,
    prezzieType,
    status = null,
    note = null,
}) => {
    return http.post("order-gift", { prezzieNum, prezzieType, status, note });
};

// 修改下单有礼
export const editOrderGift = ({
    sid,
    prezzieNum,
    prezzieType,
    status = null,
    note = null,
}) => {
    return http.put("order-gift/" + sid, {
        prezzieNum,
        prezzieType,
        status,
        note,
    });
};

// 批量删除下单有礼
export const delOrderGifts = ({ sidList }) => {
    return http.put("order-gift/delete", { sidList });
};

// 根据sid启用-停用下单有礼
export const changeOrderGiftStatus = ({ sid }) => {
    return http.put("order-gift/" + sid + "/status");
};
